{% extends "base.html" %}

{% block header%}
<title>版本列表</title>
{% endblock %}

{% block content %}
{% with model_name='Version' url_prefix='/pack/version/version_detail' base_url='/pack/version/version' %}
<script type="text/javascript">
    var request_url = "/pack/version/version",
        ColumnDefs = [
            {
                "aTargets": [6],
                "sWidth":"15%",
                "mData": function (source) {
                    var _id = source[6];
                    return "<a href='javascript:void(0);' onclick='del{{model_name}}("+ _id +
                        ")'>删除</a> &nbsp;&nbsp;" +
                        "<a href='/pack/task/release_version_detail?redo=1&v_id=" + _id +
                            "' class='openDialog'>重新打包</a> &nbsp;&nbsp;";
                }
            },
        ];

	function del{{model_name}}(id){
		if (confirmRandom('确定删除吗?')){
            $.ajax({
               url:'{{base_url}}?id='+id,
               type:'DELETE',
               success:function (result) {
                    if(result){
                       window.location.reload();
                   }else{
                       alert("删除失败！")
                   }
               }
           })
		}
	}
</script>

{% include 'query/plugins/search_form.html' %}

<div >
	<ul id="nav-list" class="nav nav-tabs" >
			  <li class="active"  >
			  	<a>版本列表</a>
			  </li>
	</ul>
	<table id="{{model_name}}_table" class="table table-bordered datatable" data-toolbar='datatable_toolbar' data-group-by-index='[5]'>
		<thead>
		<tr>
            <th>项目</th>
            <th>版本号</th>
			<th>分支名称</th>
			<th>平台</th>
			<th>SVN版本号</th>
			<th>打包时间</th>
{#			<th>状态</th>#}
			<th>操作</th>
		</tr>
		</thead>
		<tbody id="{{model_name}}_area"></tbody>
	</table>
</div>
{% endwith %}
{% endblock %}
